package utils

import (
	"errors"
	"fmt"
)

func ResourceDataProcessing(v any, typeMap map[string]int32) ([]interface{}, error) {
	values, ok := v.([]interface{})
	if !ok {
		return nil, errors.New("the value is not an array string")
	}
	tmpValue := make([]interface{}, len(values))
	for index := range values {
		tmpValue[index] = typeMap[fmt.Sprint(values[index])]
	}
	return tmpValue, nil
}
